import { request } from '../utils/request';
import { apiVirtualSuccessAccess, useVirtualAccess } from '../utils/tools';

export async function queryListData(params) {
  if (useVirtualAccess()) {
    const result = await apiVirtualSuccessAccess({
      pagesize: 10,
      total: 645,
      nowpageindex: 1,
      data: [
        {
          rowId: 1,
          intmerchantid: 2266,
          intuserid: 77604,
          intlineid: 0,
          chvmname: '枫华国际幼儿园',
          chvrealname: '李振旺',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T16:44:27.947',
        },
        {
          rowId: 2,
          intmerchantid: 2265,
          intuserid: 81402,
          intlineid: 0,
          chvmname: '都市春天站',
          chvrealname: '冯珊珊',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T16:05:06.447',
        },
        {
          rowId: 3,
          intmerchantid: 2264,
          intuserid: 80143,
          intlineid: 0,
          chvmname: '古荥镇大彭庄村服务站',
          chvrealname: '孙金龙',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T15:23:40.46',
        },
        {
          rowId: 4,
          intmerchantid: 2263,
          intuserid: 81250,
          intlineid: 0,
          chvmname: '爱亲母婴生活馆',
          chvrealname: '王鑫',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T14:22:56.993',
        },
        {
          rowId: 5,
          intmerchantid: 2262,
          intuserid: 81277,
          intlineid: 0,
          chvmname: '刘庄村',
          chvrealname: '李飞萍',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T14:17:37.743',
        },
        {
          rowId: 6,
          intmerchantid: 2261,
          intuserid: 77982,
          intlineid: 0,
          chvmname: '鸿禧阳光佳苑',
          chvrealname: '赵天戈',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T13:54:50.21',
        },
        {
          rowId: 7,
          intmerchantid: 2260,
          intuserid: 80081,
          intlineid: 0,
          chvmname: '北晨站',
          chvrealname: '王艳可',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T11:46:30.853',
        },
        {
          rowId: 8,
          intmerchantid: 2259,
          intuserid: 74806,
          intlineid: 0,
          chvmname: '方圆经纬',
          chvrealname: '行盼娟',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T11:42:52.337',
        },
        {
          rowId: 9,
          intmerchantid: 2258,
          intuserid: 71312,
          intlineid: 0,
          chvmname: '旅参谋旅行',
          chvrealname: '胡广',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T11:41:18.743',
        },
        {
          rowId: 10,
          intmerchantid: 2257,
          intuserid: 32749,
          intlineid: 0,
          chvmname: '帝湖花园',
          chvrealname: '李爽倩',
          intstate: 0,
          dtmhandletime: null,
          dtmintime: '2018-11-15T10:51:14.337',
        },
      ],
    });

    return result;
  }

  return request('/api/Saler/List', {
    method: 'POST',
    body: params,
  });
}

export async function queryGetData(params) {
  if (useVirtualAccess()) {
    const result = await apiVirtualSuccessAccess({
      data: {
        rowId: 1,
        intmerchantid: 2266,
        intuserid: 77604,
        intlineid: 0,
        chvmname: '枫华国际幼儿园',
        chvrealname: '李振旺',
        intstate: 0,
        dtmhandletime: null,
        dtmintime: '2018-11-15T16:44:27.947',
      },
    });

    return result;
  }

  return request('/api/Saler/Get', {
    method: 'POST',
    body: params,
  });
}

/**
 * 占位函数
 *
 * @export
 * @returns
 */
export async function empty() {
  return {};
}
